<!--API资产划转-支持币选着-->
<template>
  <div class="all bg1" @rightBtn="rightBtn">
    <div class="title">
      <text class="font24 text3 width240">{{T('币种列表')}}</text>
      <text class="font24 text3 width240">{{T('可用数量')}}</text>
    </div>
    <div class="line line1"></div>
    <list class="all">
      <cell v-for="(item, index) in coins" v-bind:key="index">
        <div :class="['cell', coin == item.currency ? 'bg3' : '']" @click="coinClick(item.currency)">
          <text class="font28 text2 width240">{{item.currency}}</text>
          <text class="font28 text2">{{item.withdrawAvailable}}</text>
        </div>
        <div class="line-left40 bg4"></div>
      </cell>
    </list>
  </div>
</template>

<style src="@/_css/style.css" ></style>
<style scoped>
/*********************** 标题*/
.title {
  flex-direction: row;
  align-items: center;
  height: 72px;
  padding-left: 40px;
}
.line{
  height: 1px;
}
.line-left40{
  margin-left: 40px;
  height: 1px;
}

/*********************** 列表*/
.cell {
  flex-direction: row;
  align-items: center;
  height: 100px;
  padding-left: 40px;
}

/*********************** 间距*/
.width240{
  width: 240px;
}
</style>
<script>

import jconfig from "@/_js/config";
import jmath from "@/_js/math";
import jnavigator from "@/_js/navigator";
import jbroadcast from "@/_js/broadcast"; 

const weexFunction = weex.requireModule("WeexFunction");

import I18N from "@/_i18n/i18n";
var T = I18N.t;
weexFunction.setTitle(T("选择币种"));
weexFunction.setRightBtn(T('确认'));

export default {
  
  data() {
    return {
      T:T,
      Config:jconfig,

      coin: undefined,
      coins: undefined,
    };
  },

  created() {
    var param = weex.config;
    this.coin = param.coin;
    this.coins = param.coins;
  },

  methods: {
    /*************************************************通信触发*/
    //右按钮触发
    rightBtn() {
      jbroadcast.send('SelectCoin', this.coin);
      jnavigator.back();
    },

    /********************************** 点击触发*/
    coinClick(coin){
      this.coin = coin;
    }
  },
};

</script>
